import { ActionProps, BaseInfo } from "~/types/enum";

export class UserLogin {
  name: string = "";
  pwd: string = "";
  verify: string = "";
  timestamp: string = "";
}

export enum UserApi {
  GetList = "api/User/GetList",
  AddorUpdate = "api/User/AddorUpdate",
  CheckData = "api/User/CheckUserCode",
  Delete = "api/User/Delete",
  GetDetail = "api/User/GetListe",
  Reduction = "api/User/Reduction",
  Login = "api/Authority/Login",
  Logout = "api/Authority/Logout",
  UploadyHead = "/api/User/UploadyHead",
  UpdatePwd = "api/User/UpdatePwd",
  GetLoginFirst = "api/User/GetLoginFirst",
  GetVerifyCode = "/api/Authority/GetUserVerifyCode",
  DownImportUrl = "/down/用户信息导入模版.xls",
  GetMenuPermission = "api/Authority/GetMenuPermission",
  GetUserInfo = "api/User/GetUserInfo"
}

export class UserAction {
  actionPros: ActionProps = {
    addCode: "UserAdd",
    deleteCode: "UserDelete",
    updateCode: "UserUpdate",
    queryCode: "UserGetList",
    importCode: "UsersImport",
    exportCode: "UserExport",
    downImportCode: "UserDownImport",
    reductionCode: "UserReduction",
    recyclebinCode: "UserRecyclebin"
  };
}

export interface NeedUpdatePwdInfo {
  isNeedUpdatePwd?: boolean;
  needUpdatePwdMsg?: string;
}

export interface UserInfo extends BaseInfo {
  uCode: string;
  uName: string;
  uPhone: string;
  uMobile: string;
  uEmail: string;
  uIdCardType: string;
  uIdCardNo: string;
  uAge: string;
  uSex: string;
  uBirthday: any;
  uBirthdayb: any;
  loginError: string;
  appid: string;
  lasttimeupw: string;
  uploadyhead: string;
  pca: any;
  address: string;
  retrytime: string;
  retrycount: string;
  logintime: string;
  associateuon: string;
  associateuonuser: string;
  LoginType: string;
  bindTime: string;
  country: string;
  resetpwd: string;
  uPwd: string;
  avatar: string;
  rName: string;
  rId: any;
  rIds: any;
  pcaremark: string;
  pcas: any;
}

export const apiParams = (): any => {
  return {
    sortFile: "Id",
    sortType: "desc",
    files: "*",
    pageIndex: 1,
    pageSize: 20,
    uName: "",
    uCode: "",
    rName: "",
    uMobile: "",
    status: "-1",
    stime: "",
    etime: "",
    sttime: "",
    ettime: ""
  };
};
